﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.CompositeUI;
using Microsoft.Practices.CompositeUI.SmartParts;
using Microsoft.Practices.ObjectBuilder;
using WPFCABShell.Shell.Interface.Services.Skinning;

namespace Bellucci
{
	public sealed class Module : ModuleInit, IBuilderAware
	{
		private ISkinningService _skinningService;
		private WorkItem _workItem;

		[InjectionConstructor]
		public Module([ServiceDependency] ISkinningService skinningService, [ServiceDependency] WorkItem workItem)
		{
			_skinningService = skinningService;
			_workItem = workItem;
		}

		void IBuilderAware.OnBuiltUp(string id)
		{
			//register the skin
			_skinningService.Add("Bellucci", typeof(Resources));
			//show the explanatory view
			_workItem.Workspaces[WPFCABShell.Shell.Interface.Workspaces.MainWorkspace].Show(_workItem.SmartParts.AddNew<BellucciView>(), new SmartPartInfo("Bellucci", null));
		}

		void IBuilderAware.OnTearingDown()
		{
		}
	}
}
